package com.tnfb.service.impl;

import com.tnfb.mapper.UserMapper;
import com.tnfb.model.User;
import com.tnfb.service.UserService;
import org.springframework.stereotype.Component;

@Component
public class UserServiceImpl implements UserService {

	private UserMapper userMapper;

	public UserMapper getUserMapper() {
		return userMapper;
	}

	public void setUserMapper(UserMapper userMapper) {
		this.userMapper = userMapper;
	}

	public User getUserById(int id) {
		return userMapper.selectByPrimaryKey(id);
	}

	public void saveUser(User user) {
//		userMapper.insert(user);
//		抛出运行时异常，sql会自动rollback
//		throw new RuntimeException();
	}

}
